//
//  LSZImageViewAndLaeblTableViewCell.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/8/20.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZImageViewAndLaeblTableViewCell.h"


@implementation LSZImageViewAndLaeblTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewIcon = [[UIImageView alloc]init];
        self.imageViewIcon.frame = CGRectMake(10, 10, 120, 80);
        [self addSubview:self.imageViewIcon];
        
        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewIcon.frame)+10, CGRectGetMinY(self.imageViewIcon.frame)+5, ScreenWidth-20-CGRectGetMaxX(self.imageViewIcon.frame), 40);
        self.labelTitle.numberOfLines = 2;
        self.labelTitle.textColor = titleColorLSZ;
        self.labelTitle.font = FONT_(16);
        [self addSubview:self.labelTitle];
        
        self.imageViewBrowse = [[UIImageView alloc]init];
        self.imageViewBrowse.image = [UIImage imageNamed:@"浏览"];
        self.imageViewBrowse.frame = CGRectMake(CGRectGetMaxX(self.imageViewIcon.frame)+10, CGRectGetMaxY(self.imageViewIcon.frame)-22-5, 22, 22);
        [self addSubview:self.imageViewBrowse];
        
        self.labelBrowse = [[UILabel alloc]init];
        self.labelBrowse.textColor = lightColor;
        self.labelBrowse.font = FONT_(13);
        self.labelBrowse.text = @"222";
        self.labelBrowse.frame = CGRectMake(CGRectGetMaxX(self.imageViewBrowse.frame)+5, CGRectGetMinY(self.imageViewBrowse.frame), 30, 22);
        [self addSubview:self.labelBrowse];
        
        self.imageViewCollection = [[UIImageView alloc]init];
        self.imageViewCollection.image = [UIImage imageNamed:@"收藏"];
        self.imageViewCollection.frame = CGRectMake(CGRectGetMaxX(self.labelBrowse.frame)+10, CGRectGetMinY(self.imageViewBrowse.frame), 22, 22);
        [self addSubview:self.imageViewCollection];
        
        self.labelCollection = [[UILabel alloc]init];
        self.labelCollection.textColor = lightColor;
        self.labelCollection.text = @"222";
        self.labelCollection.font = FONT_(13);
        self.labelCollection.frame = CGRectMake(CGRectGetMaxX(self.imageViewCollection.frame)+5, CGRectGetMinY(self.imageViewBrowse.frame), ScreenWidth-CGRectGetMaxX(self.imageViewCollection.frame)-10, 22);
        [self addSubview:self.labelCollection];
        
    }
    return self;
}
-(void)setManager:(LSZArticleDetailsMg *)manager
{
    [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:manager.coverUrl] placeholderImage:[UIImage imageNamed:@"默认"]];
    self.labelTitle.text = manager.name;
    
    self.labelBrowse.text = manager.counts;
    self.labelCollection.text = [NSString stringWithFormat:@"%@     %@",manager.publish,manager.publishTime];
    
    self.imageViewCollection.image = [UIImage imageNamed:@""];

}
-(void)setSecondaryInterfaceMg:(LSZSecondaryInterfaceMg *)secondaryInterfaceMg
{
    [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:secondaryInterfaceMg.coverUrl] placeholderImage:[UIImage imageNamed:@"默认"]];
    self.labelTitle.text = secondaryInterfaceMg.name;
    
//    self.labelBrowse.text = secondaryInterfaceMg.times;
//    self.labelCollection.text = [NSString stringWithFormat:@"%@     %@",secondaryInterfaceMg.publish,secondaryInterfaceMg.publishTime];
}
@end
